<%@page import="com.wodwl.entity.Blog"%>
<%@page import="com.wodwl.entity.User"%>
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
	<%@include file="../templete/head.jsp"  %>
	<script type="text/javascript" src="../../static/ckeditor/ckeditor.js"></script>
	<style type="text/css">
		.mainRight .btn{
			float: right;
			margin-right: 5px;
		}
		.title .editor{
			margin-left: 5px;
			font-size: 10px;
		}
		.content .conbar{
			margin:5px 0 10px 0;
			font-size: 12px;
		}
		.conbar .left{
			margin-right: 10px;
		}
		.conbar .right{
			float: right;
			margin-left:10px;
		}
	</style>
	
</head>
<body >
	<%pageContext.setAttribute("linkType", "6");%>
	<%@include file="../templete/banner.jsp"  %>
	<%Blog blog = (Blog) request.getAttribute("blog");%>
		
		<div class="mainRight">
			<div class="mainRightBar">
				<div class="title">
					<%=blog.getTitle()%>
					<span class="editor">
						<%if (blog.getUsername().equals(user.getUsername())) {%>
							<a href="/blog/blog_editor1.do?bid=<%=blog.getBid()%>" >编辑</a>
						<%}%>
					</span>
				</div>
				
				<div class="myblog_btn btn" >我的博客</div>
				<div class="blog_category_btn btn">博客分类</div>
				<div class="blog_list_btn btn" >博客列表</div>
				<div class="write_blog_btn btn" >写博客</div>
			</div>
			<div class="content">
				<div class="conbar">
					<span class="left">
						作者：<a href="/user/info_display.do?username=<%=user.getUsername()%>&request_username=<%=blog.getUsername()%>"><%=blog.getUsername()%></a>
					</span>
					<span class="left"><%=sdf.format(blog.getCreate_time())%></span>
					<span class="right">举报</span>
					<span class="right">收藏(<%=blog.getFavorite_count() %>)</span>
					<span class="right">评论(<%=blog.getComment_count() %>)</span>
					<span class="right">阅读(<%=blog.getRead_count() %>)</span>
				</div>
				<div class="con">
				 	<%=blog.getContent()%>
			 	</div>
								
			</div>
		</div>
	</div>
<%@include file="../templete/footer.jsp"  %>
<script type="text/javascript">
	$(document).ready(function(){
		$(".btn").button();
		
		$(".write_blog_btn").click(function(){
			window.location.href="/blog/blog_add_view.do";
		});
		$(".blog_list_btn").click(function(){
			window.location.href="/blog/blog_list.do";
		});
		$(".blog_category_btn").click(function(){
			window.location.href="/blog/category_list.do";
		});
		$(".myblog_btn").click(function(){
			window.location.href="#";
		});
		
	});
	</script>	
</body>
</html>